fix bytevector-ieee-double-native-set! error#1025
fix bytevector-ieee-double-native-set! error#1025gus-massa wants to merge 1 commit intocisco:mainfrom
Conversation
When the last argument raises an error and the offset is out of the bounds, the compiler was reorganizing the code and the out of bound error was raised instead. (define bv (make-bytevector 16 0)) (define (f x) (bytevector-ieee-double-native-set! bv 100 (+ x 1))) (f 'bad)
cab4dcf to
d8b918b
Compare
|
[Rebase after version and submodule change. Not changes in my PR code.] |
|
The flags to How about introducing We should also add regression tests for the original problem and to check that For release notes, how about this rephrasing?
|
|
For some reason I was assuming that This is wrong, but perhaps it's correct for some specific cases like I agree with your changes. I guess it does not break flonum unboing but I'm not sure if it's possible to "see" it using something similar to A minor comment, is that I don't like |
When the last argument raises an error and the offset is out of the bounds, the compiler was reorganizing the code and the out of bound error was raised instead.
I think it's isolated enough to be fixed now, but it's more tricky than what I expected.
It's almost a single line change, but I'm not sure if I'm using correctly the flags of
bindto ensure that the last argument of#2%bytevector-ieee-double-native-set!is correctly handled when it's anunboxed flonum. Also, I think once the temporary variable is marked asfpthen#3%bytevector-ieee-double-native-set!will not expand to$real->flonumanother time, just use the variable.